/* Octopus PDF - A simple document viewer for Android.
   Copyright (C) 2013  Gerald Thaler

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
package de.geraldthaler.octopuspdf;

import java.nio.ByteBuffer;

import de.geraldthaler.octopuspdf.docrender.DocSource;

/**
 * @author Gerald Thaler
 */
public final class Native {
    static {
        System.loadLibrary("octopuspdf");
    }

	public static native boolean authenticatePassword(long mupdfCtx, String password);
    public static native void blitToTexture(long pixmap, int width, int left, int top, int right, int bottom,
    		ByteBuffer texture);
    public static native void cancelRender(long mupdfCtx);
    public static native void clearMupdf(long mupdfCtx);
    public static native void deleteMupdfCtx(long mupdfCtx);
    public static native long fetchPixmap(long mupdfCtx, int index);
    public static native void freePixmap(long pixmap);
    public static native int getPageCount(long mupdfCtx);
    public static native float getPageWidth(long mupdfCtx, int index);
    public static native float getPageHeight(long mupdfCtx, int index);
    public static native void loadPage(long mupdfCtx, int index, int pageNr);
    public static native boolean needsPassword(long mupdfCtx);
    public static native long newMupdfCtx(final DocSource docSource);
    public static native void prepareRender(long mupdfCtx, int count);
    public static native void renderPage(long mupdfCtx, int index, int width, int height, int left, int top, int right,
            int bottom);
}
